package com.dong.example.entity;

import com.dong.es.anno.DTOCastAnno;
import com.dong.es.anno.DTOCastAnnos;
import com.dong.es.entity.EsViewDTO;
import com.dong.es.entity.dtocast.base.*;

import java.util.Date;

/**
 * @description: 用户操作的参数
 * @author: 陈瑞东
 * @create: 2022-12-07 15:53
 */
@DTOCastAnnos({
        // 精确查询
        @DTOCastAnno(sort = 10, field = DemoESDTO.ID, paramFields = {"id"}, method = DTOCastTerm.class),
        @DTOCastAnno(sort = 10, field = DemoESDTO.NAME, paramFields = {"name"}, method = DTOCastTerm.class),
        // 时间范围
        @DTOCastAnno(sort = 900, field = DemoESDTO.QUERY_TIME, paramFields = {"startQueryTime", "endQueryTime"}, method = DTOCastRange.class),
        // 分页
        @DTOCastAnno(sort = 910, paramFields = {"pageNo", "pageSize"}, method = DTOCastFromSize.class),
        // 排序
        @DTOCastAnno(sort = 920, paramFields = {"orderBy"}, method = DTOCastOrderBy.class),
        @DTOCastAnno(sort = 930, paramStrs = {DemoESDTO.QUERY_TIME + " DESC"}, method = DTOCastOrderBy.class),
        // 聚合
        @DTOCastAnno(sort = 930, field = DemoESDTO.NAME, paramStrs = {"String"} , method = DTOCastTermsAgg.class, enabledField = "enabled", enabled = true),
})
public class DemoESViewDTO extends EsViewDTO {

    private static final long serialVersionUID = -6320160137925083888L;

    // 数据编号
    private Long id;
    // 姓名
    private String name;

    // 页码
    private Integer pageNo;

    // 每页数量
    private Integer pageSize;

    // 排序
    private String orderBy;

    // 开始时间
    private Date startQueryTime;

    // 结束时间
    private Date endQueryTime;

    // 是否启用
    private Boolean enabled;

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public Date getStartQueryTime() {
        return startQueryTime;
    }

    public void setStartQueryTime(Date startQueryTime) {
        this.startQueryTime = startQueryTime;
    }

    public Date getEndQueryTime() {
        return endQueryTime;
    }

    public void setEndQueryTime(Date endQueryTime) {
        this.endQueryTime = endQueryTime;
    }
}
